home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2372 < prev    next >
Mailbox/MIME Entity  |  1996-08-06  |  2.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 50 61 74 68 3a 20 |.lang.c+|+.Path: |
|00000020| 63 61 6e 74 61 6c 6f 75 | 70 65 2e 73 72 76 2e 63 |cantalou|pe.srv.c|
|00000030| 73 2e 63 6d 75 2e 65 64 | 75 21 72 6f 63 68 65 73 |s.cmu.ed|u!roches|
|00000040| 74 65 72 21 72 6f 63 6b | 73 61 6e 6e 65 21 6e 65 |ter!rock|sanne!ne|
|00000050| 77 73 0a 46 72 6f 6d 3a | 20 4b 65 69 74 68 20 42 |ws.From:| Keith B|
|00000060| 61 67 6c 65 79 20 3c 6b | 65 69 74 68 62 40 67 70 |agley <k|eithb@gp|
|00000070| 69 6d 2e 78 65 72 6f 78 | 2e 63 6f 6d 3e 0a 53 75 |im.xerox|.com>.Su|
|00000080| 62 6a 65 63 74 3a 20 52 | 65 3a 20 48 65 6c 70 20 |bject: R|e: Help |
|00000090| 77 69 74 68 20 63 69 6e | 2e 67 65 74 28 29 20 0a |with cin|.get() .|
|000000a0| 43 6f 6e 74 65 6e 74 2d | 54 79 70 65 3a 20 54 45 |Content-|Type: TE|
|000000b0| 58 54 2f 50 4c 41 49 4e | 3b 20 63 68 61 72 73 65 |XT/PLAIN|; charse|
|000000c0| 74 3d 55 53 2d 41 53 43 | 49 49 0a 4d 65 73 73 61 |t=US-ASC|II.Messa|
|000000d0| 67 65 2d 49 44 3a 20 3c | 4e 45 57 54 4e 65 77 73 |ge-ID: <|NEWTNews|
|000000e0| 2e 38 32 31 38 33 39 38 | 32 35 2e 32 37 33 30 38 |.8218398|25.27308|
|000000f0| 2e 6b 65 69 74 68 40 6b | 65 69 74 68 2e 67 70 69 |.keith@k|eith.gpi|
|00000100| 6d 2e 78 65 72 6f 78 2e | 63 6f 6d 3e 0a 53 65 6e |m.xerox.|com>.Sen|
|00000110| 64 65 72 3a 20 6e 65 77 | 73 40 6e 65 77 73 2e 77 |der: new|s@news.w|
|00000120| 72 63 2e 78 65 72 6f 78 | 2e 63 6f 6d 0a 4f 72 67 |rc.xerox|.com.Org|
|00000130| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 58 65 72 6f 78 |anizatio|n: Xerox|
|00000140| 0a 58 2d 4e 65 77 73 72 | 65 61 64 65 72 3a 20 4e |.X-Newsr|eader: N|
|00000150| 45 57 54 4e 65 77 73 20 | 26 20 43 68 61 6d 65 6c |EWTNews |& Chamel|
|00000160| 65 6f 6e 20 2d 2d 20 54 | 43 50 2f 49 50 20 66 6f |eon -- T|CP/IP fo|
|00000170| 72 20 4d 53 20 57 69 6e | 64 6f 77 73 20 66 72 6f |r MS Win|dows fro|
|00000180| 6d 20 4e 65 74 4d 61 6e | 61 67 65 0a 52 65 66 65 |m NetMan|age.Refe|
|00000190| 72 65 6e 63 65 73 3a 20 | 3c 34 63 71 62 6a 61 24 |rences: |<4cqbja$|
|000001a0| 36 32 6e 40 65 61 72 74 | 68 2e 6e 6a 63 63 2e 63 |62n@eart|h.njcc.c|
|000001b0| 6f 6d 3e 20 20 3c 34 64 | 66 39 68 66 24 66 65 63 |om> <4d|f9hf$fec|
|000001c0| 40 6e 65 77 73 2e 70 61 | 63 69 66 69 65 72 2e 63 |@news.pa|cifier.c|
|000001d0| 6f 6d 3e 20 0a 4d 69 6d | 65 2d 56 65 72 73 69 6f |om> .Mim|e-Versio|
|000001e0| 6e 3a 20 31 2e 30 0a 44 | 61 74 65 3a 20 54 75 65 |n: 1.0.D|ate: Tue|
|000001f0| 2c 20 31 36 20 4a 61 6e | 20 31 39 39 36 20 32 33 |, 16 Jan| 1996 23|
|00000200| 3a 34 38 3a 32 32 20 47 | 4d 54 0a 0a 0a 49 6e 20 |:48:22 G|MT...In |
|00000210| 61 72 74 69 63 6c 65 20 | 3c 34 64 66 39 68 66 24 |article |<4df9hf$|
|00000220| 66 65 63 40 6e 65 77 73 | 2e 70 61 63 69 66 69 65 |fec@news|.pacifie|
|00000230| 72 2e 63 6f 6d 3e 2c 20 | 3c 64 67 61 67 65 72 40 |r.com>, |<dgager@|
|00000240| 70 61 63 69 66 69 65 72 | 2e 63 6f 6d 3e 20 77 72 |pacifier|.com> wr|
|00000250| 69 74 65 73 3a 0a 3e 20 | 50 61 74 68 3a 20 72 6f |ites:.> |Path: ro|
|00000260| 63 6b 73 61 6e 6e 65 21 | 72 6f 63 68 65 73 74 65 |cksanne!|rocheste|
|00000270| 72 21 75 64 65 6c 21 67 | 61 74 65 63 68 21 75 73 |r!udel!g|atech!us|
|00000280| 65 6e 65 74 2e 65 65 6c | 2e 75 66 6c 2e 65 64 75 |enet.eel|.ufl.edu|
|00000290| 21 70 61 63 69 66 69 65 | 72 21 75 73 65 6e 65 74 |!pacifie|r!usenet|
|000002a0| 0a 3e 20 46 72 6f 6d 3a | 20 64 67 61 67 65 72 40 |.> From:| dgager@|
|000002b0| 70 61 63 69 66 69 65 72 | 2e 63 6f 6d 20 28 44 61 |pacifier|.com (Da|
|000002c0| 76 65 20 47 61 67 65 72 | 29 0a 3e 20 4e 65 77 73 |ve Gager|).> News|
|000002d0| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 6c 61 6e |groups: |comp.lan|
|000002e0| 67 2e 63 2b 2b 0a 3e 20 | 53 75 62 6a 65 63 74 3a |g.c++.> |Subject:|
|000002f0| 20 52 65 3a 20 48 65 6c | 70 20 77 69 74 68 20 63 | Re: Hel|p with c|
|00000300| 69 6e 2e 67 65 74 28 29 | 0a 3e 20 44 61 74 65 3a |in.get()|.> Date:|
|00000310| 20 31 36 20 4a 61 6e 20 | 31 39 39 36 20 30 34 3a | 16 Jan |1996 04:|
|00000320| 32 38 3a 33 31 20 47 4d | 54 0a 3e 20 4f 72 67 61 |28:31 GM|T.> Orga|
|00000330| 6e 69 7a 61 74 69 6f 6e | 3a 20 50 61 63 69 66 69 |nization|: Pacifi|
|00000340| 65 72 20 49 6e 74 65 72 | 6e 65 74 20 53 65 72 76 |er Inter|net Serv|
|00000350| 65 72 20 28 33 36 30 29 | 20 36 39 33 2d 30 33 32 |er (360)| 693-032|
|00000360| 35 0a 3e 20 4c 69 6e 65 | 73 3a 20 34 39 0a 3e 20 |5.> Line|s: 49.> |
|00000370| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 34 64 66 |Message-|ID: <4df|
|00000380| 39 68 66 24 66 65 63 40 | 6e 65 77 73 2e 70 61 63 |9hf$fec@|news.pac|
|00000390| 69 66 69 65 72 2e 63 6f | 6d 3e 0a 3e 20 52 65 66 |ifier.co|m>.> Ref|
|000003a0| 65 72 65 6e 63 65 73 3a | 20 3c 34 63 71 62 6a 61 |erences:| <4cqbja|
|000003b0| 24 36 32 6e 40 65 61 72 | 74 68 2e 6e 6a 63 63 2e |$62n@ear|th.njcc.|
|000003c0| 63 6f 6d 3e 0a 3e 20 52 | 65 70 6c 79 2d 54 6f 3a |com>.> R|eply-To:|
|000003d0| 20 64 67 61 67 65 72 40 | 70 61 63 69 66 69 65 72 | dgager@|pacifier|
|000003e0| 2e 63 6f 6d 0a 3e 20 4e | 4e 54 50 2d 50 6f 73 74 |.com.> N|NTP-Post|
|000003f0| 69 6e 67 2d 48 6f 73 74 | 3a 20 69 70 36 31 2e 76 |ing-Host|: ip61.v|
|00000400| 61 6e 32 2e 70 61 63 69 | 66 69 65 72 2e 63 6f 6d |an2.paci|fier.com|
|00000410| 0a 3e 20 4d 69 6d 65 2d | 56 65 72 73 69 6f 6e 3a |.> Mime-|Version:|
|00000420| 20 31 2e 30 0a 3e 20 58 | 2d 4e 65 77 73 72 65 61 | 1.0.> X|-Newsrea|
|00000430| 64 65 72 3a 20 57 69 6e | 56 4e 20 30 2e 39 39 2e |der: Win|VN 0.99.|
|00000440| 32 0a 3e 20 0a 3e 20 49 | 6e 20 61 72 74 69 63 6c |2.> .> I|n articl|
|00000450| 65 20 3c 34 63 71 62 6a | 61 24 36 32 6e 40 65 61 |e <4cqbj|a$62n@ea|
|00000460| 72 74 68 2e 6e 6a 63 63 | 2e 63 6f 6d 3e 2c 20 63 |rth.njcc|.com>, c|
|00000470| 68 72 69 73 40 70 6c 75 | 74 6f 2e 6e 6a 63 63 2e |hris@plu|to.njcc.|
|00000480| 63 6f 6d 20 73 61 79 73 | 2e 2e 2e 0a 3e 20 3e 0a |com says|....> >.|
|00000490| 3e 20 3e 49 20 75 73 65 | 20 74 68 69 73 20 66 75 |> >I use| this fu|
|000004a0| 6e 63 74 69 6f 6e 20 74 | 6f 20 69 6e 70 75 74 20 |nction t|o input |
|000004b0| 61 20 62 6f 6f 6b 20 74 | 69 74 6c 65 20 77 69 74 |a book t|itle wit|
|000004c0| 68 20 69 6d 62 65 64 64 | 65 64 20 62 6c 61 6e 6b |h imbedd|ed blank|
|000004d0| 73 3a 0a 3e 20 3e 0a 3e | 20 3e 20 20 20 20 76 6f |s:.> >.>| > vo|
|000004e0| 69 64 20 67 65 74 64 61 | 74 61 28 29 0a 3e 20 3e |id getda|ta().> >|
|000004f0| 20 20 20 20 20 20 20 7b | 0a 3e 20 3e 20 20 20 20 | {|.> > |
|00000500| 20 20 20 63 6f 75 74 20 | 3c 3c 20 22 45 6e 74 65 | cout |<< "Ente|
|00000510| 72 20 74 69 74 6c 65 3a | 20 22 3b 0a 3e 20 3e 20 |r title:| ";.> > |
|00000520| 20 20 20 20 20 20 63 69 | 6e 2e 67 65 74 28 74 69 | ci|n.get(ti|
|00000530| 74 6c 65 2c 20 4c 45 4e | 29 3b 0a 3e 20 3e 20 20 |tle, LEN|);.> > |
|00000540| 20 20 20 20 20 63 6f 75 | 74 20 3c 3c 20 22 45 6e | cou|t << "En|
|00000550| 74 65 72 20 70 72 69 63 | 65 3a 20 22 3b 0a 3e 20 |ter pric|e: ";.> |
|00000560| 3e 20 20 20 20 20 20 20 | 63 69 6e 20 3e 3e 20 70 |> |cin >> p|
|00000570| 72 69 63 65 3b 0a 3e 20 | 3e 20 20 20 20 20 20 20 |rice;.> |> |
|00000580| 7d 0a 3e 20 3e 0a 3e 20 | 3e 70 72 6f 62 6c 65 6d |}.> >.> |>problem|
|00000590| 20 69 73 2c 20 69 66 20 | 49 20 65 78 65 63 75 74 | is, if |I execut|
|000005a0| 65 20 74 68 65 20 66 75 | 6e 63 74 69 6f 6e 20 6d |e the fu|nction m|
|000005b0| 6f 72 65 20 74 68 61 6e | 20 6f 6e 63 65 2c 20 69 |ore than| once, i|
|000005c0| 74 20 73 6b 69 70 73 20 | 74 68 65 20 74 69 74 6c |t skips |the titl|
|000005d0| 65 20 0a 3e 20 69 6e 70 | 75 74 20 0a 3e 20 3e 6f |e .> inp|ut .> >o|
|000005e0| 6e 20 74 68 65 20 73 65 | 63 6f 6e 64 20 61 6e 64 |n the se|cond and|
|000005f0| 20 65 76 65 72 79 20 73 | 75 62 73 65 71 75 65 6e | every s|ubsequen|
|00000600| 74 20 65 78 65 63 75 74 | 69 6f 6e 20 28 69 2e 65 |t execut|ion (i.e|
|00000610| 2e 20 74 68 65 20 6c 69 | 6e 65 20 77 69 6c 6c 20 |. the li|ne will |
|00000620| 0a 3e 20 72 65 73 65 6d | 62 6c 65 3a 0a 3e 20 3e |.> resem|ble:.> >|
|00000630| 20 20 20 20 20 45 6e 74 | 65 72 20 74 69 74 6c 65 | Ent|er title|
|00000640| 3a 20 45 6e 74 65 72 20 | 70 72 69 63 65 3a 20 0a |: Enter |price: .|
|00000650| 3e 20 3e 6e 65 76 65 72 | 20 6f 66 66 65 72 69 6e |> >never| offerin|
|00000660| 67 20 74 68 65 20 6f 70 | 70 75 72 74 75 6e 69 74 |g the op|purtunit|
|00000670| 79 20 74 6f 20 65 6e 74 | 65 72 20 74 68 65 20 74 |y to ent|er the t|
|00000680| 69 74 6c 65 29 2e 0a 3e | 20 3e 0a 3e 20 3e 49 20 |itle)..>| >.> >I |
|00000690| 73 75 73 70 65 63 74 20 | 74 68 69 73 20 6c 69 74 |suspect |this lit|
|000006a0| 74 6c 65 20 22 62 75 67 | 22 20 61 72 69 73 65 73 |tle "bug|" arises|
|000006b0| 20 66 72 6f 6d 20 61 20 | 73 75 62 74 6c 65 20 6d | from a |subtle m|
|000006c0| 69 73 75 73 65 20 6f 66 | 20 63 69 6e 2e 67 65 74 |isuse of| cin.get|
|000006d0| 28 29 2e 20 20 0a 3e 20 | 43 61 6e 20 0a 3e 20 3e |(). .> |Can .> >|
|000006e0| 61 6e 79 6f 6e 65 20 69 | 64 65 6e 74 69 66 79 20 |anyone i|dentify |
|000006f0| 69 74 20 66 6f 72 20 6d | 65 3f 20 20 54 68 69 73 |it for m|e? This|
|00000700| 20 69 73 20 6f 62 76 69 | 6f 75 73 6c 79 20 61 20 | is obvi|ously a |
|00000710| 62 65 67 69 6e 6e 65 72 | 20 71 75 65 73 74 69 6f |beginner| questio|
|00000720| 6e 2e 0a 3e 20 3e 0a 3e | 20 3e 4d 79 20 74 68 61 |n..> >.>| >My tha|
|00000730| 6e 6b 73 20 61 6e 64 20 | 61 70 6f 6c 6f 67 69 65 |nks and |apologie|
|00000740| 73 2e 0a 3e 20 3e 63 68 | 72 69 73 2e 0a 3e 20 3e |s..> >ch|ris..> >|
|00000750| 63 68 72 69 73 40 70 6c | 75 74 6f 2e 6e 6a 63 63 |chris@pl|uto.njcc|
|00000760| 2e 63 6f 6d 0a 3e 20 0a | 3e 20 0a 3e 20 20 54 77 |.com.> .|> .> Tw|
|00000770| 6f 20 74 68 69 6e 67 73 | 20 63 6f 6d 65 20 74 6f |o things| come to|
|00000780| 20 6d 69 6e 64 20 77 69 | 74 68 6f 75 74 20 73 65 | mind wi|thout se|
|00000790| 65 69 6e 67 20 74 68 65 | 20 72 65 73 74 20 6f 66 |eing the| rest of|
|000007a0| 20 74 68 65 20 63 6f 64 | 65 2e 2e 2e 2e 0a 3e 20 | the cod|e.....> |
|000007b0| 0a 3e 20 4e 75 6d 62 65 | 72 20 6f 6e 65 3a 20 59 |.> Numbe|r one: Y|
|000007c0| 6f 75 72 20 76 61 72 69 | 61 62 6c 65 20 4c 45 4e |our vari|able LEN|
|000007d0| 20 66 6f 72 20 74 68 65 | 20 6d 61 78 20 6e 75 6d | for the| max num|
|000007e0| 62 65 72 20 6f 66 20 63 | 68 61 72 73 20 69 6e 20 |ber of c|hars in |
|000007f0| 74 68 65 20 62 6f 6f 6b | 20 0a 3e 20 74 69 74 6c |the book| .> titl|
|00000800| 65 2e 2e 2e 20 69 66 20 | 74 68 65 20 74 69 74 6c |e... if |the titl|
|00000810| 65 20 64 6f 65 73 6e 27 | 74 20 66 69 6c 6c 20 74 |e doesn'|t fill t|
|00000820| 68 65 20 74 68 65 20 6d | 61 78 20 6e 75 6d 62 65 |he the m|ax numbe|
|00000830| 72 2c 20 79 6f 75 72 20 | 65 6e 74 65 72 20 70 72 |r, your |enter pr|
|00000840| 69 63 65 20 0a 3e 20 77 | 69 6c 6c 20 66 69 6c 6c |ice .> w|ill fill|
|00000850| 20 74 68 65 20 72 65 6d | 61 69 6e 69 6e 67 20 62 | the rem|aining b|
|00000860| 75 66 66 65 72 2e 0a 3e | 20 0a 3e 20 4e 75 6d 62 |uffer..>| .> Numb|
|00000870| 65 72 20 74 77 6f 3a 20 | 59 6f 75 20 6e 65 65 64 |er two: |You need|
|00000880| 20 74 6f 20 66 6c 75 73 | 68 20 6f 75 74 20 74 68 | to flus|h out th|
|00000890| 65 20 69 6e 70 75 74 20 | 73 74 72 65 61 6d 20 74 |e input |stream t|
|000008a0| 6f 20 72 65 6d 6f 76 65 | 20 61 6e 79 20 70 72 65 |o remove| any pre|
|000008b0| 76 69 6f 75 73 20 0a 3e | 20 72 65 73 69 64 75 65 |vious .>| residue|
|000008c0| 2c 20 61 6e 64 20 74 6f | 20 68 65 6c 70 20 61 6c |, and to| help al|
|000008d0| 6c 65 76 69 61 74 65 20 | 74 68 65 20 70 72 6f 62 |leviate |the prob|
|000008e0| 6c 65 6d 20 6e 75 6d 62 | 65 72 20 6f 6e 65 20 61 |lem numb|er one a|
|000008f0| 62 6f 76 65 2e 20 49 74 | 27 73 20 62 65 65 6e 20 |bove. It|'s been |
|00000900| 61 20 0a 3e 20 77 68 69 | 6c 65 2c 20 62 75 74 20 |a .> whi|le, but |
|00000910| 49 20 74 68 69 6e 6b 20 | 74 68 65 72 65 20 69 73 |I think |there is|
|00000920| 20 61 20 63 6c 65 61 72 | 28 29 20 6f 72 20 66 6c | a clear|() or fl|
|00000930| 75 73 68 28 29 20 66 75 | 6e 63 74 69 6f 6e 20 74 |ush() fu|nction t|
|00000940| 6f 20 61 63 63 6f 6d 70 | 6c 69 73 68 20 0a 3e 20 |o accomp|lish .> |
|00000950| 74 68 69 73 2e 20 43 68 | 65 63 6b 20 79 6f 75 72 |this. Ch|eck your|
|00000960| 20 63 6f 6d 70 69 6c 65 | 72 73 20 6c 61 6e 67 75 | compile|rs langu|
|00000970| 61 67 65 20 72 65 66 65 | 72 65 6e 63 65 20 74 6f |age refe|rence to|
|00000980| 20 66 69 6e 64 20 6f 75 | 74 2e 0a 3e 20 20 20 20 | find ou|t..> |
|00000990| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009b0| 20 20 20 20 20 20 48 6f | 70 65 20 74 68 69 73 20 | Ho|pe this |
|000009c0| 68 65 6c 70 73 21 0a 3e | 20 20 20 20 20 20 20 20 |helps!.>| |
|000009d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2d 44 61 76 | | -Dav|
|00000a00| 65 0a 0a 41 6c 73 6f 20 | 74 72 79 20 73 79 6e 63 |e..Also |try sync|
|00000a10| 68 72 6f 6e 69 7a 69 6e | 67 20 74 68 65 20 69 6e |hronizin|g the in|
|00000a20| 70 75 74 20 73 74 72 65 | 61 6d 2e 20 55 73 65 20 |put stre|am. Use |
|00000a30| 63 69 6e 2e 73 79 6e 63 | 28 29 2c 20 66 61 69 6c |cin.sync|(), fail|
|00000a40| 69 6e 67 20 74 68 61 74 | 2c 0a 74 72 79 20 74 68 |ing that|,.try th|
|00000a50| 65 20 69 67 6e 6f 72 65 | 28 29 20 6d 65 74 68 6f |e ignore|() metho|
|00000a60| 64 20 28 69 67 6e 6f 72 | 69 6e 67 20 27 5c 6e 27 |d (ignor|ing '\n'|
|00000a70| 20 77 69 74 68 20 61 20 | 6c 61 72 67 65 20 6e 75 | with a |large nu|
|00000a80| 6d 62 65 72 20 66 6f 72 | 20 74 68 65 0a 6d 61 78 |mber for| the.max|
|00000a90| 20 63 68 61 72 61 63 74 | 65 72 73 20 70 61 72 61 | charact|ers para|
|00000aa0| 6d 65 74 65 72 29 0a 0a | 4b 65 69 74 68 42 0a 0a |meter)..|KeithB..|
+--------+-------------------------+-------------------------+--------+--------+